---
title: Send DEF email reminder
summary: Looks up the assigned attorney's manager email and sends a DEF reminder, redirected to the current user outside Production.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
operation_id: OP-LGL-004
trigger: Triggered after PrintDEF/schedule save, when a DEF email is due
---

# Send DEF email reminder

This operation looks up the assigned attorney's manager email address and sends a DEF reminder email, applying a non-Production safety redirect.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-LGL-004 |
| **Trigger** | `clsScheduleManager.SendDEFEmail()` invoked |
| **Inputs** | Assigned attorney ID, current application environment |
| **Outputs** | Reminder email sent via `Mail.SendMail`; `SendDefFlag` reset |
| **Primary components** | `clsScheduleManager.SendDEFEmail` |
| **Entry point** | `SAIF.Application.Claim.Legal\LegalNet\clsScheduleManager.vb` |

## Steps

1. Look up the assigned attorney's manager email via an inline scalar query: `select pk80001_LEGALNET.get_atty_mngr_email(:caseSeqNum) from dual` ([SQL-020](../sql/SQL-020-get-attorney-manager-email.md)).
2. Evaluate `AppGlobal.EnvironmentService.GetApplicationEnvironment()`:
   - If not Production: redirect the email to the current user's own address (`DPI.UserID@saif.com`) and annotate the body with the "real" intended recipient ([BR-LGL-005](../business-rules.md#br-lgl-005-non-production-def-email-reminders-are-redirected-to-the-current-user)).
   - If Production: send to the real recipient address unmodified.
3. Reset `SendDefFlag` to No.
4. Propagate the reset flag to consolidated cases.
   - See [Consolidated-case propagation](consolidated-case-propagation.md) for the secondary-case update logic.
5. Send the email via `Mail.SendMail` (`SAIF.BOF.Framework.Mail`).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([SendDEFEmail invoked]) --> Lookup[Lookup manager email<br>via get_atty_mngr_email]
	Lookup --> Env{Production environment?}
	Env -->|No| Redirect[Redirect to current user<br>annotate real recipient]
	Env -->|Yes| Real[Use real recipient]
	Redirect --> Reset[Reset SendDefFlag to No]
	Real --> Reset
	Reset --> Consol[Propagate flag reset to<br>consolidated cases]
	Consol --> Send[Send mail via Mail.SendMail]
	Send --> EndOk([Done])
```

## Failure and edge-case behavior

- Non-Production environments: the real intended recipient never receives the email directly; it is instead noted in the body sent to the current user.
- No dedicated error handling was observed around the `Mail.SendMail` call itself in this operation's Stage 1 analysis findings.*

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Application.Claim.Legal\LegalNet\clsScheduleManager.vb`
